import Vue from "vue";
import Router from "vue-router";
import userlist from "../view/user/userlist";
import adduser from "../view/shangpin/adduser";
import goodlist from '../view/dingdan/goodlist';

Vue.use(Router);

export default new Router({
  routes: [{
      path: '/login',
      meta: {
        title: '登录'
      },
      component: () => import('@/view/login/login')
    },

    {
      path: '/',
      component: () => import('@/view/main'),
      children: [{
          path: '/',
          meta: {
            title: '首页'
          },
          component: () => import('@/view/shouye.vue')
        },
        {
          path: "/userlist",
          meta: {
            title: '用户管理'
          },
          component: userlist
        }, {
          path: '/add',
          meta: {
            title: '添加用户'
          },
          component: adduser
        }, {
          path: '/goodlist',
          meta: {
            title: '订单管理'
          },
          component: goodlist
        }, {
          path: '/detail',
          meta: {
            title: '用户详情'
          },
          component: () => import('@/view/user/detail.vue')
        },
        {
          path: '/cpxq',
          meta: {
            title: '产品详情'
          },
          component: () => import('@/view/shangpin/cpxq.vue')
        },
        {
          path: '/fabushangpi',
          meta: {
            title: '发布商品'
          },
          component: () => import('@/view/shangpin/fabushangpi.vue')
        }, {
          path: '/tousu',
          meta: {
            title: '投诉管理'
          },
          component: () => import('@/view/tousu/tousu.vue')
        },
        {
          path: '/banner',
          meta: {
            title: '轮播图管理'
          },
          component: () => import('@/view/banner/banner.vue')
        },
        {
          path: '/flgl',
          meta: {
            title: '分类管理'
          },
          component: () => import('@/view/neirong/flgl.vue')
        },
        {
          path: '/plgl',
          meta: {
            title: '评论管理'
          },
          component: () => import('@/view/neirong/plgl.vue')
        },
        {
          path: '/tjfl',
          meta: {
            title: '添加管理'
          },
          component: () => import('@/view/neirong/tjfl.vue')
        },
        {
          path: '/lihaibanner',
          meta: {
            title: '历史轮播图'
          },
          component: () => import('@/view/banner/lihaibanner.vue')
        },
        {
          path: '/fabubanner',
          meta: {
            title: '发布轮播图'
          },
          component: () => import('@/view/banner/fabubanner.vue')
        },
        {
          path: '/huishouzhanbanner',
          meta: {
            title: '轮播图回收站'
          },
          component: () => import('@/view/banner/huishouzhanbanner.vue')
        },
        {
          path: '/huishouzhan',
          meta: {
            title: '回收站'
          },
          component: () => import('@/view/shangpin/huishouzhan.vue')
        },
        {
          path: '/adddingdan',
          meta: {
            title: '订单详情'
          },
          component: () => import('@/view/dingdan/adddingdan.vue')
        },
        {
          path: '/dingdanhuifu',
          meta: {
            title: '订单恢复'
          },
          component: () => import('@/view/dingdan/dingdanhuigfu.vue')
        },
      ]
    },
    {
      path: '*',
      meta: {
        title: '未找到页面'
      },
      component: () => import('@/view/error/404')
    }
  ]
});
